In forage harvesters of the above type, control of the spout position and of the position of a pivotable end portion (flap) of the spout on the basis of camera images is known in the art. Patent publication WO-A-2011101458 describes a system in which a 3D camera 15 is arranged on the discharge spout. The camera takes images of the container driving next to the machine. These images define at least two vertical strips. Analysis of these strips provides the position of the front and/or rear wall of the container relative to the camera. Based on this information, the spout is controlled so that the crop material is unloaded in the container.